package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserPointDecrease;
import com.culturalCenter.dataCenter.mapper.user.UserPointDecreaseMapper;
import com.culturalCenter.dataCenter.service.user.UserPointDecreaseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserPointDecrease业务层接口实现类
 * @Date
 *****/
@Service
public class UserPointDecreaseServiceImpl implements UserPointDecreaseService {

    @Resource
    private UserPointDecreaseMapper userPointDecreaseMapper;

    @Override
    public PageInfo<UserPointDecrease> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userPointDecreaseMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userPointDecreaseMapper.deleteById(id);
    }

    @Override
    public Integer update(UserPointDecrease userPointDecrease) {
        return userPointDecreaseMapper.update(userPointDecrease);
    }

    @Override
    public Integer add(UserPointDecrease userPointDecrease) {
        return userPointDecreaseMapper.insert(userPointDecrease);
    }

    @Override
    public UserPointDecrease findById(String id) {
        return userPointDecreaseMapper.queryById(id);
    }

    @Override
    public List<UserPointDecrease> findAll(UserPointDecrease userPointDecrease) {
        return (List<UserPointDecrease>) userPointDecreaseMapper.queryAll(userPointDecrease);
    }

}
